<!-- 继承公共视图文件 -->
<extend name="./Application/Admin/View/layout.html" />
 <!-- 可变内容区域 -->
 <block name="mid">

	<div class="row">
	    <div class="col-md-6">
	        <div class="panel panel-default">
	            <div class="panel-heading">
	                <h2><i class="fa fa-indent red"></i><strong>员工信息编辑</strong></h2>
	            </div>
				<form action="" method="post" id="signupForm" enctype="multipart/form-data" class="form-horizontal">
				    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="file-input">头像</label>
                            <div class="col-md-9">
                              <notempty name="data['avatar']">
                                <img src="__ROOT__/{$data.avatar}" width="100" height="100">
                                <a href="{:U('Admin/admin/del_avatar/id/'.$data['id'])}" class="btn btn-sm btn-danger">删除</a>

                              <else/>
                                <input type="file" id="file" name="file">
                              </notempty>
                            </div>
                        </div>

		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="text-input">帐号</label>
		                    <div class="col-md-9">
		                        <input type="text" value="{$data.username}" id="username" name="username" class="form-control" placeholder="请输入账号">
		                        <span class="help-block error"></span>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="text-input">真实姓名</label>
		                    <div class="col-md-9">
		                        <input type="text" value="{$data.realname}" id="realname" name="realname" class="form-control" placeholder="请输入真实姓名">
		                        <span class="help-block error"></span>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="email-input">邮箱</label>
		                    <div class="col-md-9">
		                        <input type="email" value="{$data.email}" id="email" name="email" class="form-control" placeholder="请输入邮箱">
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="text-input">QQ</label>
		                    <div class="col-md-9">
		                        <input type="text" value="{$data.qq}" id="qq" name="qq" class="form-control" placeholder="请输入qq">
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="text-input">手机</label>
		                    <div class="col-md-9">
		                        <input type="text" value="{$data.tel}" id="tel" name="tel" class="form-control" placeholder="请输入电话">
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="text-input">地址</label>
		                    <div class="col-md-9">
		                        <input type="text" value="{$data.address}" id="address" name="address" class="form-control" placeholder="请输入地址">
		                    </div>
		                </div><!--
		                <div class="form-group">
		                    <label class="col-md-3 control-label" for="select">所属角色</label>
		                    <div class="col-md-9">
		                        <select id="select" name="select" class="form-control" size="1">
		                            <option value="0">Please select</option>
		                            <option value="1">Option #1</option>
		                            <option value="2">Option #2</option>
		                            <option value="3">Option #3</option>
		                        </select>
		                    </div>
		                </div> -->
		                <div class="form-group">
		                    <label class="col-md-3 control-label">性别</label>
		                    <div class="col-md-9">
		                        <label class="radio-inline" for="inline-radio1">
		                        	<input type="radio" id="sex" name="sex" {$v['sex']?'checked':''} value="1"> 男
		                        </label>
		                        <label class="radio-inline" for="inline-radio2">
		                        	<input type="radio" id="sex" name="sex" {$v['sex']?'':'checked'} value="0"> 女
		                        </label>
		                    </div>
		                    <span class="help-block error"></span>
		                </div>

						<br>
				</div>
				<div class="panel-footer">
                    <button type="submit"  class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 提交</button>
                    <button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> 重置</button>
                </div>
		      </form>
	        </div>
	    </div>

	</div><!--/.row-->

</block>
<block name="js">

    <script type="text/javascript" src="__ADMIN__assets/js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="__ADMIN__assets/js/jquery.validate.min.js"></script>
	<script type="text/javascript">
		$(function(){

		  // 在键盘按下并释放及提交后验证提交表单
		  $("#signupForm").validate({

		  	// debug:true,  //开发的时候组织表单提交

		  	// 验证规则
		    rules: {
              /*'username':'required', //必填验证(单个规则写法)*/

              // 多个验证写法
              'username':{
              	 required:true,
              	 maxlength:10,
                 minlength:4,
              },
              'password':{
              	 required:true,
              	 equalTo:"#cpassword",  //密码输入框的值必须和确认密码输入框的值一样
              },
              'sex':{
              	 required:true,
              }
		    },

		    // 错误信息提示
		    messages: {
		      username: {
		        required: "请输入用户名",
		        maxlength: "用户名长度必需在4~10位数之间",
		        minlength: "用户名长度必需在4~10位数之间",
		      },
		      password: {
		        required: "请输入密码",
		        equalTo: "两次密码不一致",
		      },
		      sex: {
		        required: "请选择性别",
		      },
		    },

		    errorElement:'span',



		  })


		})
	</script>
</block>